Skip to content

Fix: Use only one blank line to separate sections or paragraphs #23871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 23, 2018

Conversation

alexander-ponomaroff
Copy link
Contributor

@alexander-ponomaroff alexander-ponomaroff commented Nov 23, 2018

By running ./scripts/validate_docstrings.py --errors=GL03 --format=azure, I was able to get the list of GL03 errors with files and line numbers where these errors occurred.

I fixed a big portion of these issues so far.

@datapythonista

@pep8speaks
Copy link

Hello @alexander-ponomaroff! Thanks for submitting the PR.

@alexander-ponomaroff
Copy link
Contributor Author

Original List of Errors - 127 errors

pandas.read_table
pandas.read_csv
pandas.read_fwf
pandas.read_msgpack
pandas.io.json.json_normalize
pandas.HDFStore.select
pandas.HDFStore.walk
pandas.read_feather
pandas.read_parquet
pandas.read_sql_table
pandas.read_sql_query
pandas.read_sql
pandas.melt
pandas.crosstab
pandas.merge_ordered
pandas.merge_asof
pandas.unique
pandas.util.hash_array
pandas.util.hash_pandas_object
pandas.Series.argmin
pandas.Series.argmax
pandas.DataFrame.iterrows
pandas.DataFrame.lookup
pandas.DataFrame.add
pandas.DataFrame.sub
pandas.DataFrame.mod
pandas.DataFrame.radd
pandas.DataFrame.rsub
pandas.DataFrame.rmod
pandas.DataFrame.count
pandas.DataFrame.swaplevel
pandas.DataFrame.melt
pandas.DataFrame.plot.pie
pandas.DataFrame.from_csv
pandas.DataFrame.to_feather
pandas.Panel.xs
pandas.Panel.major_xs
pandas.Panel.minor_xs
pandas.Panel.swaplevel
pandas.Index.reindex
pandas.Index.astype
pandas.Index.intersection
pandas.Index.union
pandas.Index.difference
pandas.Index.asof_locs
pandas.Index.get_indexer
pandas.Index.get_slice_bound
pandas.CategoricalIndex
pandas.IntervalIndex.from_arrays
pandas.IntervalIndex.from_tuples
pandas.IntervalIndex.get_indexer
pandas.MultiIndex.set_levels
pandas.MultiIndex.sortlevel
pandas.MultiIndex.remove_unused_levels
pandas.MultiIndex.get_indexer
pandas.DatetimeIndex
pandas.DatetimeIndex.snap
pandas.Timedelta
pandas.Timedelta.max
pandas.Timedelta.min
pandas.tseries.offsets.BusinessHour
pandas.tseries.offsets.CustomBusinessHour
pandas.tseries.offsets.LastWeekOfMonth
pandas.core.window.Rolling.max
pandas.core.window.Rolling.aggregate
pandas.core.window.Expanding.max
pandas.core.window.Expanding.aggregate
pandas.core.window.EWM.std
pandas.core.window.EWM.var
pandas.core.window.EWM.corr
pandas.core.window.EWM.cov
pandas.core.groupby.GroupBy.apply
pandas.core.groupby.GroupBy.all
pandas.core.groupby.GroupBy.any
pandas.core.groupby.GroupBy.head
pandas.core.groupby.GroupBy.mean
pandas.core.groupby.GroupBy.median
pandas.core.groupby.GroupBy.nth
pandas.core.groupby.GroupBy.ohlc
pandas.core.groupby.GroupBy.rank
pandas.core.groupby.GroupBy.sem
pandas.core.groupby.GroupBy.std
pandas.core.groupby.GroupBy.var
pandas.core.groupby.GroupBy.tail
pandas.core.groupby.DataFrameGroupBy.agg
pandas.core.groupby.DataFrameGroupBy.all
pandas.core.groupby.DataFrameGroupBy.any
pandas.core.groupby.DataFrameGroupBy.corr
pandas.core.groupby.DataFrameGroupBy.cov
pandas.core.groupby.DataFrameGroupBy.diff
pandas.core.groupby.DataFrameGroupBy.fillna
pandas.core.groupby.DataFrameGroupBy.hist
pandas.core.groupby.DataFrameGroupBy.idxmax
pandas.core.groupby.DataFrameGroupBy.idxmin
pandas.core.groupby.DataFrameGroupBy.mad
pandas.core.groupby.DataFrameGroupBy.quantile
pandas.core.groupby.DataFrameGroupBy.rank
pandas.core.groupby.DataFrameGroupBy.shift
pandas.core.groupby.DataFrameGroupBy.skew
pandas.core.groupby.DataFrameGroupBy.take
pandas.core.groupby.DataFrameGroupBy.tshift
pandas.core.groupby.SeriesGroupBy.nlargest
pandas.core.groupby.SeriesGroupBy.nsmallest
pandas.core.groupby.SeriesGroupBy.unique
pandas.core.groupby.SeriesGroupBy.is_monotonic_increasing
pandas.core.groupby.SeriesGroupBy.is_monotonic_decreasing
pandas.core.groupby.DataFrameGroupBy.corrwith
pandas.core.resample.Resampler.iter
pandas.core.resample.Resampler.apply
pandas.core.resample.Resampler.aggregate
pandas.core.resample.Resampler.mean
pandas.core.resample.Resampler.median
pandas.core.resample.Resampler.ohlc
pandas.core.resample.Resampler.sem
pandas.io.formats.style.Styler.applymap
pandas.io.formats.style.Styler.where
pandas.io.formats.style.Styler.bar
pandas.plotting.andrews_curves
pandas.describe_option
pandas.reset_option
pandas.get_option
pandas.set_option
pandas.option_context
pandas.errors.UnsortedIndexError
pandas.api.types.pandas_dtype
pandas.api.types.is_scalar
pandas.DataFrame.subtract

Current List of Errors - 58 errors

pandas.read_table
pandas.read_csv
pandas.read_fwf
pandas.read_feather
pandas.melt
pandas.Series.argmin
pandas.Series.argmax
pandas.DataFrame.add
pandas.DataFrame.sub
pandas.DataFrame.mod
pandas.DataFrame.radd
pandas.DataFrame.rsub
pandas.DataFrame.rmod
pandas.DataFrame.melt
pandas.Panel.swaplevel
pandas.Index.reindex
pandas.IntervalIndex.from_arrays
pandas.IntervalIndex.from_tuples
pandas.Timedelta
pandas.Timedelta.max
pandas.Timedelta.min
pandas.core.window.Rolling.max
pandas.core.window.Rolling.aggregate
pandas.core.window.Expanding.max
pandas.core.window.Expanding.aggregate
pandas.core.window.EWM.std
pandas.core.window.EWM.var
pandas.core.window.EWM.corr
pandas.core.window.EWM.cov
pandas.core.groupby.GroupBy.apply
pandas.core.groupby.DataFrameGroupBy.agg
pandas.core.groupby.DataFrameGroupBy.corr
pandas.core.groupby.DataFrameGroupBy.cov
pandas.core.groupby.DataFrameGroupBy.diff
pandas.core.groupby.DataFrameGroupBy.fillna
pandas.core.groupby.DataFrameGroupBy.hist
pandas.core.groupby.DataFrameGroupBy.idxmax
pandas.core.groupby.DataFrameGroupBy.idxmin
pandas.core.groupby.DataFrameGroupBy.mad
pandas.core.groupby.DataFrameGroupBy.quantile
pandas.core.groupby.DataFrameGroupBy.skew
pandas.core.groupby.DataFrameGroupBy.take
pandas.core.groupby.DataFrameGroupBy.tshift
pandas.core.groupby.SeriesGroupBy.nlargest
pandas.core.groupby.SeriesGroupBy.nsmallest
pandas.core.groupby.SeriesGroupBy.unique
pandas.core.groupby.SeriesGroupBy.is_monotonic_increasing
pandas.core.groupby.SeriesGroupBy.is_monotonic_decreasing
pandas.core.groupby.DataFrameGroupBy.corrwith
pandas.core.resample.Resampler.apply
pandas.core.resample.Resampler.aggregate
pandas.plotting.andrews_curves
pandas.describe_option
pandas.reset_option
pandas.get_option
pandas.set_option
pandas.api.types.is_scalar
pandas.DataFrame.subtract

@codecov
Copy link

codecov bot commented Nov 23, 2018

Codecov Report

Merging #23871 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23871   +/-   ##
=======================================
  Coverage   92.29%   92.29%           
=======================================
  Files         161      161           
  Lines       51497    51497           
=======================================
  Hits        47530    47530           
  Misses       3967     3967
Flag Coverage Δ
#multiple 90.69% <ø> (ø) ⬆️
#single 42.42% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/reshape/pivot.py 96.55% <ø> (ø) ⬆️
pandas/io/json/normalize.py 96.87% <ø> (ø) ⬆️
pandas/core/indexes/multi.py 95.49% <ø> (ø) ⬆️
pandas/util/_decorators.py 91.34% <ø> (ø) ⬆️
pandas/core/resample.py 96.99% <ø> (ø) ⬆️
pandas/plotting/_core.py 83.63% <ø> (ø) ⬆️
pandas/io/packers.py 88.08% <ø> (ø) ⬆️
pandas/core/config.py 87.17% <ø> (ø) ⬆️
pandas/core/util/hashing.py 98.4% <ø> (ø) ⬆️
pandas/io/parquet.py 84.61% <ø> (ø) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5c90e5...bb0e375. Read the comment docs.

@jreback jreback added the Docs label Nov 23, 2018
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@datapythonista datapythonista merged commit dc0674d into pandas-dev:master Nov 23, 2018
@datapythonista
Copy link
Member

Thanks for taking care of those @alexander-ponomaroff

I kept the issue open, as you mention that there are still 58 errors to fix. Was there any impediment to fix those, or there were just too many for a single PR?

@alexander-ponomaroff
Copy link
Contributor Author

@datapythonista No problem! The other errors were a bit problematic. Some of them didn't show the line number and file, and some showed error in the actual code and not the docs. I will further look into those to see if I can figure out what needs to be fixed.

@datapythonista
Copy link
Member

Yes, unfortunately the introspection to detect where a function is defined doesn't work well if the function is created in a tricky way (and we do that somehow often for better code organization and not repeating code in pandas).

One option (tricky but effective) is check the docstring with for example scripts/validate_docstrings.py pandas.Series.head and then grep for the shot summary of any part that looks like it should be unique.

The good news is that I think many of the pending one in your list reuse docstring, so there are probably one third of the number in the list that need to fixed.

@alexander-ponomaroff
Copy link
Contributor Author

@datapythonista I will keep this in mind for the future, thanks!

Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Use only one blank line to separate sections or paragraphs
5 participants